<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ page language="java" %>
<%@ page import="java.util.*,org.apache.log4j.Category" %>

<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
   String strModuleName = "UPM";
%>
<%@ include file="/inc/PageDefault.inc" %>
<html>
<head>
<title>left</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="css/<%= strLanguageCode %>/chinese/csscontent.css" type="text/css">
<link rel="stylesheet" href="css/<%= strLanguageCode %>/csscontent.css" type="text/css">
<script language="JavaScript" src="css/<%= strLanguageCode %>/chinese/script.js"></script>
<script language="JavaScript" src="js/FuncLib.js"></script>
<script language="JavaScript" src="js/cookie.js"></script>
<script language="JavaScript">
function loginCheck(form)
{
 // if(isEmpty(form.orgcode.value))
 // {
    <%--[SCRIPT]  alert("<#%= message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_Org",false)) %#>");  [SCRIPT]--%>
   <%--[SCRIPT]   form.orgcode.focus();  [SCRIPT]--%>
   <%--[SCRIPT]   return false;  [SCRIPT]--%>
  //}
  if(isEmpty(form.username.value))
  {
    alert("<%= message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_UserName",false)) %>");
    form.username.focus();
    return false;
  }
  if(isEmpty(form.password.value))
  {
    alert("<%= message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_Password",false)) %>");
    form.password.focus();
    return false;
  }
  if(isEmpty(form.orgcode.value))
  {
    form.orgcode.disabled=true;
  }
  return true;
}
function view_notes(id)
{
  var viewurl = "biee/NotesInfoPop.jsp?<%= OvalTools.randomURL() %>&languagecode=<%= strLanguageCode %>&notesid=" + id;
  popup(viewurl,'newwindow','height=400,width=600,top=100,left=100,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no');
}

function page_login()
{
  if(!loginCheck(leftform))
    return;
  setCookie("oval_username",document.leftform.username.value);
  //setCookie("oval_orgcode",document.leftform.orgcode.value);
  setCookie("oval_app",document.leftform.app.value);
  document.leftform.actionname.value = "login";
  isRunning = true;
  document.leftform.submit();
}
function App_Changed()
  {
  <%--[SCRIPT]    if(top.popupwindow!=null)  [SCRIPT]--%>
  <%--[SCRIPT]       top.popupwindow.close();  [SCRIPT]--%>
  <%--[SCRIPT]    url ="HomePage.jsp";  [SCRIPT]--%>
  <%--[SCRIPT]    url = url + "?app="+document.leftform.app.options[document.leftform.app.selectedIndex].value;  [SCRIPT]--%>
  <%--[SCRIPT]    parent.location.href = url;  [SCRIPT]--%>
  }
</script>
  </head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="leftform" method="post" action="Dispatcher" target="_parent">
<input type="hidden" name="pagename" value="left">
<input type="hidden" name="actionname">
<input type="hidden" name="languagecode" value="<%= strLanguageCode %>">


<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
  <tr>
     <td colspan="2" valign="top" bgcolor="6DA6DA">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td> 
            <table cellspacing=0 cellpadding=3 width="100%" align=center 
                  border=0>
							<tbody> 
								<tr bgcolor="FFD35E">
    							<td colspan=2 height=20>
    								<div align="center"><%= label.getLabelName("L_LogIn") %>
    								</div>
    							</td>
  							</tr>

  <tr bgcolor="#efefef">
    <td colspan="2" height="55">
      <table width="100%" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="2" height="10"></td>
        </tr>
        <tr>
          <td bgcolor="#efefef" height="25">
          	<div align="right"><%= label.getLabelName("L_SystemForLog") + label.getLabelName("L_Colon")%>
          	</div>
          </td>
					<td>
          <%
            Integer strApp=(Integer)session.getAttribute("app");
            if(strApp==null)
              strApp=new Integer(1);
            pageContext.setAttribute("app",strApp);
          %>
          <select name="app">
	          <option value="1" Selected>DMS</option>
	          <!--<option value="4">FIM</option>-->
	          <option value="9">IMG</option>
	          <option value="11">CM</option>     
          </select>
          </td>
        </tr>
       <!-- <tr>
          <td width=42 bgcolor="#efefef" height="25">
          	<div align="right"><%= label.getLabelName("L_Org") + label.getLabelName("L_Colon")%>
          	</div>	
          </td>
          <td bgcolor="#efefef">
            <input type="text" name="orgcode" size="15" maxlength="50" value="" style="font-size:11px;" class="input-blue-bg" onkeydown="javascript:if(window.event.keyCode == 13)page_login();">
          </td>
        </tr>-->
        <tr>
          <td bgcolor="#efefef" height="25">
          	<div align="right"><%= label.getLabelName("L_User") + label.getLabelName("L_Colon")%>
          	</div>
          </td>
          <td bgcolor="#efefef">
            <input type="text" name="username" size="15" maxlength="50" value="" style="font-size:11px;" class="input-blue-bg" onkeydown="javascript:if(window.event.keyCode == 13)page_login();">
          </td>
        </tr>
        <tr>
          <td bgcolor="#efefef" height="25">
          	<div align="right"><%= label.getLabelName("L_Password") %><%= label.getLabelName("L_Colon") %>
          	</div>
          </td>
          <td bgcolor="#efefef">
            <input type="password" name="password" size="15" maxlength="50" value="" style="font-size:11px;" class="input-blue-bg" onkeydown="javascript:if(window.event.keyCode == 13)page_login();">
          </td>
        </tr>
      </table>
    </td>
  </tr>
 </form>
 <%
    String strCanRegester=(String)pageContext.getAttribute("canregister");
    if(strCanRegester==null)
        strCanRegester="";
 %>
  <tr bgcolor="#efefef">
    <td class="td_center" bgcolor="#efefef" colspan="2" ><%if(strCanRegester.equalsIgnoreCase("Y")){%><a onclick="parent.mainFrame.location.href='masterdata/upm/RegStep1.jsp?<%= OvalTools.randomURL() %>';"><custom:button type="1" label="L_Register" imgsrc="register2.gif" border="0" style="width:60"/></a><%}%>&nbsp;
    <a onclick="page_login()" target="_parent"><img src="images/<%= strLanguageCode %>/chinese/login_btn.gif" width="77" height="20" border="0"></a> 
    </td>
  </tr>                                                                                                          
  <tr>
    <td bgcolor="234781" height="20">&nbsp;</td>
  </tr>
       
         
			</table>
    </td>
  </tr>
  <tr> 
    <td colspan="2" bgcolor="6DA6DA" >&nbsp;</td>
  </tr>    
</table>
<script language="JavaScript">
//if(getCookie("oval_orgcode") != null)
//  leftform.orgcode.value = getCookie("oval_orgcode");
if(getCookie("oval_username") != null)
  leftform.username.value = getCookie("oval_username");

var hasAppInCookie = 0;
if(getCookie("oval_app") != null && getCookie("oval_app") != -1){
 var apptmp = getCookie("oval_app");
 for(var i=0;i<leftform.app.options.length;i++)
    if(leftform.app.options[i].value == apptmp){
      leftform.app.options[i].selected = true;
      hasAppInCookie = 1;
    }
}
if(hasAppInCookie == 0)
  leftform.app.options[0].selected = true;

leftform.username.focus();
form.orgcode.disabled=false;
</script>
</body>
</html>
